import * as mongoose from 'mongoose';

import config from '../config/config';
import { DBCONSTANTS } from './db.constants';

export const databaseProviders = [
  {
    provide: DBCONSTANTS.databaseConnection,
    useFactory: (): Promise<typeof mongoose> =>
      mongoose.connect(config.mongodb.url, { useNewUrlParser: true })
  }
];
